<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title><spring:message code='Multimedia.resource.manage'/></title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
        $(document).ready(function() {
            floorChange();
            autochange();
         /*   $("#imageGroup.toFloor").on("change",function(e){
                autochange();
			});*/

            $("#inputForm").validate({
                submitHandler: function(form){

                    var table = document.getElementById("eleSourceVideoList");
                    var rows = table.rows.length ;
                    var tableImg = document.getElementById("eleSourceImageList");
                    var rowsImg = tableImg.rows.length ;
                    var type = $("#type").val();

                        if(type == "video"){
                            var deleted = new Array()
                            if(rows!=0){
                                for (var i=0;i<rows;i++) {
                                    var startDate = document.getElementById("videoGroup.eleSourceVideoList" + i + "_startDate").value;
                                    var startTime = document.getElementById("videoGroup.eleSourceVideoList" + i + "_startTime").value;
                                    var endDate = document.getElementById("videoGroup.eleSourceVideoList" + i + "_endDate").value;
                                    var endTime = document.getElementById("videoGroup.eleSourceVideoList" + i + "_endTime").value;
                                    console.log(startTime + "--->" + endTime);

                                    if(document.getElementById("videoGroup.eleSourceVideoList"+i).className =='error'){

                                    }else {
                                        deleted[i] = [document.getElementById("videoGroup.eleSourceVideoList" + i + "_index").value]
                                        if ((startDate != null && startDate != "") ) {
                                            if (endDate == null || endDate == ""){
                                                alertx("<spring:message code='tip.enddata'/>");
                                                return false;
                                            }
                                        }
                                        if ((endDate != null && endDate != "") ) {
                                            if (startDate == null || startDate == ""){
                                                alertx("<spring:message code='tip.startdata'/>");
                                                return false;
                                            }
                                        }
                                        if ((startTime != null && startTime != "") ) {
                                            if (endTime == null || endTime == ""){
                                                alertx("<spring:message code='tip.endtime'/>");
                                                return false;
                                            }
                                        }
                                        if ((endTime != null && endTime != "") ) {
                                            if (startTime == null || startTime == ""){
                                                alertx("<spring:message code='tip.starttime'/>");
                                                return false;
                                            }
                                        }

										/*  if ((startTime != null && startTime != "") ||(endTime != null && endTime != "")) {
										 if (startTime != null && startTime != "") {
										 alertx("结束时间必选");
										 return false;
										 }else if(endTime != null && endTime != ""){
										 alertx("开始时间必选");
										 return false;
										 }
										 }*/

                                        console.log(startDate + startTime);
                                        console.log(endDate + endTime);
										/*if(startDate != null && endDate != null){
										 var date1 = new Date(Date.parse(startDate.replace("-", "/")));
										 var date2 = new Date(Date.parse(endDate.replace("-", "/")));
										 var comp1 = date1 < date2;
										 }*/
                                        var date1 = startDate +startTime;
                                        var date2 = endDate +endTime;
                                        if(date1 > date2) {
                                            if((endDate != null && endDate != "") ){
                                                if(startDate > endDate) {
                                                    alertx("<spring:message code='tip.startend'/>");
                                                    return false;
                                                }
                                            }
                                            if((endTime != null && endTime != "") ){
                                                if(startTime > endTime) {
                                                    alertx("<spring:message code='tip.startendTime'/>");
                                                    return false;
                                                }
                                            }

                                        }


                                    }
                                }
                                var s = deleted.join(",") +",";
                                for(var i = 0; i < deleted.length; i++)
                                {
                                    $("input").css("border","");
                                    if(s.replace(deleted[i] + ",", "").indexOf(deleted[i] +",") > -1)
                                    {

                                        document.getElementById("videoGroup.eleSourceVideoList"+i+"_index").style.border="1px solid red";

                                        alertx("<spring:message code='tip.repeat'/>");
                                        return false;
                                    }
                                }
								/*}*/
							}

						} else if(type == "image"){

                            var imageary = new Array()
                            if(rowsImg!=0){
                                for (var i=0;i<rowsImg;i++) {

                                    if(document.getElementById("imageGroup.eleSourceImageList"+i).className =='error'){

                                    }else {
                                        imageary[i] = [document.getElementById("imageGroup.eleSourceImageList" + i + "_index").value]
                                    }

                                }
                                var s = imageary.join(",") +",";
								/* if (imageary.length>1){*/
                                for(var i = 0; i < imageary.length; i++)
                                {
                                    $("input").css("border","");
                                    if(s.replace(imageary[i] + ",", "").indexOf(imageary[i] +",") > -1)
                                    {
										/*var du=s.replace(imageary[i] + ",", "").indexOf(imageary[i] +",");*/
                                        document.getElementById("imageGroup.eleSourceImageList"+i+"_index").style.border="1px solid red";
										/* document.getElementById("videoGroup.eleSourceVideoList"+du+"_index").style.border="1px solid red";*/
                                        alertx("<spring:message code='tip.repeat'/>");
                                        return false;
                                    }
                                }
							}


						}


                    loading('<spring:message code="common.subbmiting"/>');
                    timeVali($("#btnSubmit"));
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function(error, element) {
                    $("#messageBox").text("输入有误，请先更正。");
                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                },
                rules:{
                    "imageGroup.interval":{
                        isIntGtZero:true
                    }
                },
                //如果验证控件没有message，将调用默认的信息
                messages:{
                    "imageGroup.interval":{
                        isIntGtZero:"请输入大于0的整数"
                        //isFloat:"请输入浮点数"
                        //isInteger:"请输入整数"
                    }

                }
            });
        });

        function addRow(list, idx, tpl, row){
            var floor = $("#imageGroup\\.toFloor").val();
            if(floor == "false"){
                tpl = tpl.replace("<td class=\"floor\">", "<td class=\"floor\" style=\"display: none\">");
            }else{
            }

            var addRow = "yes";
            var editRow = "";
            if(row != null){
                addRow = "";
                editRow = "yes";
            }
            var rowIdx = idx+1;
            $(list).append(Mustache.render(tpl, {
                idx: idx, delBtn: true, row: row,addRow:addRow,editRow:editRow,rowIdx:rowIdx
            }));
            $(list+idx).find("select").each(function(){
                $(this).val($(this).attr("data-value"));
            });
            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
                var ss = $(this).attr("data-value").split(',');
                for (var i=0; i<ss.length; i++){
                    if($(this).val() == ss[i]){
                        $(this).attr("checked","checked");
                    }
                }
            });
        }
        function delRow(obj, prefix){
            console.log("prefix"+ prefix);
            var id = $(document.getElementById(prefix+"_id"));
            console.log(id);
            console.log($(document.getElementById("imageGroup.eleSourceImageList0_id")).val());
            var delFlag = $(document.getElementById(prefix+"_delFlag"));
            if (id.val() == ""){
                $(obj).parent().parent().remove();
            }else if(delFlag.val() == "0"){
                delFlag.val("1");
                $(obj).html("&divide;").attr("title", "撤销删除");
                $(obj).parent().parent().addClass("error");
                $(obj).parent().parent().css("display","none");
            }else if(delFlag.val() == "1"){
                delFlag.val("0");
                $(obj).html("&times;").attr("title", "<spring:message code='common.delete'/>");
                $(obj).parent().parent().removeClass("error");
            }
        }
        function sourceTypeChange(){
            var type = $("#type").val();
            if(type == "video"){
                $("#imageSource").attr("style","display:none");
                $("#videoSource").attr("style","display:visible");
            }else{
                $("#imageSource").attr("style","display:visible");
                $("#videoSource").attr("style","display:none");
            }
        }
        function autochange() {
            var tofloor=document.getElementById("imageGroup.toFloor").value;
            if(tofloor=="true"){
                document.getElementById("imageGroup.autoPlay").value="false";
                document.getElementById("imageGroup.interval").value="3";
                document.getElementById("autoShow").style.display="none";
                document.getElementById("autoShow1").style.display="none";
            }else {
                document.getElementById("imageGroup.autoPlay").value="true";
                document.getElementById("autoShow").style.display="";
                document.getElementById("autoShow1").style.display="";
            }
        }

        function floorChange(){
            autochange();
			/* var id="imageGroup.toFloor";*/
            var floor = $("#imageGroup\\.toFloor").val();
            if(floor == "false"){
				/*  alert("aaaaaa")*/
                $('.floorval').val("");
                $(".floor").css("cssText", "display:none;");
				/*$(".floor").css("display","none");*/
//                $("#videoSource").attr("style","display:visible");
            }else{

				/* alert("aaaavvvvvvvvvvvaa")*/
                $(".floor").css("cssText", "display:visible;");
				/*  $("#videoSource").attr("style","display:none");*/
            }
        }
	</script>
</head>

<body>
<ul class="nav nav-tabs">
	<li><a href="${ctx}/source/eleSourceMultimedia/"><spring:message code='Multimedia.resource.list'/></a></li>
	<li class="active"><a href="${ctx}/source/eleSourceMultimedia/form?id=${eleSourceMultimedia.id}">
		<shiro:hasPermission name="source:eleSourceMultimedia:edit">
			<c:if test="${not empty eleSourceMultimedia.id}">
				<spring:message code="Multimedia.resource.modify"/>
			</c:if>
			<c:if test="${empty eleSourceMultimedia.id}">
				<spring:message code="Multimedia.resource.add"/>
			</c:if>
		</shiro:hasPermission>
		<shiro:lacksPermission name="source:eleSourceMultimedia:edit">
			<spring:message code="Multimedia.resource.info"/>
		</shiro:lacksPermission></a></li>
</ul>
<br/>
<form:form id="inputForm" modelAttribute="eleSourceMultimedia" action="${ctx}/source/eleSourceMultimedia/save" method="post" class="form-horizontal">
<form:hidden path="id"/>
<sys:message content="${message}"/>
<div class="control-group">
	<label class="control-label"><spring:message code="common.dname"/>：</label>
	<div class="controls">
		<form:input path="name" htmlEscape="false" maxlength="25" class="input-large required" />
		<span class="help-inline"><font color="red">*</font> </span>
	</div>
</div>
<c:if test="${language == 'zh'}">
	<div class="control-group">
		<label class="control-label"><spring:message code="type"/>：</label>
		<div class="controls">
			<form:select path="type" class="input-small " onchange="sourceTypeChange();">
				<form:options items="${fns:getDictList('multimedia')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</form:select>
		</div>
	</div>
</c:if>
<c:if test="${language == 'en'}">
	<div class="control-group">
		<label class="control-label"><spring:message code="type"/>：</label>
		<div class="controls">
			<form:select path="type" class="input-small " onchange="sourceTypeChange();">
				<form:options items="${fns:getDictList('multimedia')}" itemLabel="enlabel" itemValue="value" htmlEscape="false"/>
			</form:select>
		</div>
	</div>
</c:if>
<c:choose>
<c:when test="${eleSourceMultimedia.type == 'image'}">
<div id="imageSource" style="display:visible;">
	</c:when>
	<c:otherwise>
	<div id="imageSource" style="display:none;">
		</c:otherwise>
		</c:choose>
		<c:if test="${language == 'zh'}">
			<div class="control-group">
				<label class="control-label"><spring:message code='Corresponding.floor'/>：</label>
				<div class="controls">
					<form:select path="imageGroup.toFloor" class="input-small " onchange="floorChange();">
						<form:options items="${fns:getDictList('truefalse')}" itemLabel="label" itemValue="value" htmlEscape="false"  />
					</form:select>
				</div>
			</div>
		</c:if>
		<c:if test="${language == 'en'}">
			<div class="control-group">
				<label class="control-label"><spring:message code='Corresponding.floor'/>：</label>
				<div class="controls">
					<form:select path="imageGroup.toFloor" class="input-small " onchange="floorChange();">
						<form:options items="${fns:getDictList('truefalse')}" itemLabel="label" itemValue="value" htmlEscape="false"  />
					</form:select>
				</div>
			</div>
		</c:if>
		<c:if test="${language == 'zh'}">
			<div class="control-group" style="display: none">
				<label class="control-label"><spring:message code='Auto.play'/>：</label>
				<div class="controls">
					<form:select path="imageGroup.autoPlay" class="input-small ">
						<form:options items="${fns:getDictList('falsetrue')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					</form:select>
				</div>
			</div>
			<div class="control-group " id="autoShow">
				<label class="control-label"><spring:message code='Transition.effect'/>：</label>
				<div class="controls">
					<form:select path="imageGroup.transitionEffect" class="input-small ">
						<form:options items="${fns:getDictList('transition_effect')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					</form:select>
				</div>
			</div>
		</c:if>
		<c:if test="${language == 'en'}">
			<div class="control-group"  style="display: none">
				<label class="control-label"><spring:message code='Auto.play'/>：</label>
				<div class="controls">
					<form:select path="imageGroup.autoPlay" class="input-small ">
						<form:options items="${fns:getDictList('falsetrue')}" itemLabel="enlabel" itemValue="value" htmlEscape="false"/>
					</form:select>
				</div>
			</div>
			<div class="control-group " id="autoShow">
				<label class="control-label"><spring:message code='Transition.effect'/>：</label>
				<div class="controls">
					<form:select path="imageGroup.transitionEffect" class="input-small ">
						<form:options items="${fns:getDictList('transition_effect')}" itemLabel="enlabel" itemValue="value" htmlEscape="false"/>
					</form:select>
				</div>
			</div>
		</c:if>
		<div class="control-group " id="autoShow1">
			<label class="control-label"><spring:message code='Picture.interval'/>：</label>
			<div class="controls">
				<form:input path="imageGroup.interval" htmlEscape="false" maxlength="7" class="input-small  required"/><spring:message code='seconds'/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group" >
			<label class="control-label"><spring:message code='Picture.resources'/>：</label>
			<div class="controls">
				<table id="contentTable" class="table table-striped table-bordered table-condensed">
					<thead>
					<tr>
						<th class="hide"></th>
						<th><spring:message code='Picture.name'/></th>
						<th><spring:message code='Play.sequence.number'/><font color="red">*</font></th>
						<th><spring:message code='picture'/><font color="red">*</font></th>
						<th class="floor"><spring:message code='Corresponding.floor'/></th>
						<shiro:hasPermission name="source:image:eleSourceImageGroup:edit">
							<th width="10">&nbsp;</th>
						</shiro:hasPermission>
					</tr>
					</thead>
					<tbody id="eleSourceImageList">
					</tbody>
					<shiro:hasPermission name="source:image:eleSourceImageGroup:edit"><tfoot>
					<tr><td colspan="7"><a href="javascript:" onclick="addRow('#eleSourceImageList', eleSourceImageRowIdx, eleSourceImageTpl);eleSourceImageRowIdx = eleSourceImageRowIdx + 1;" class="btn"><spring:message code="common.add"/></a></td></tr>
					</tfoot></shiro:hasPermission>
				</table>
				<script type="text/template" id="eleSourceImageTpl">//<!--
						<tr id="imageGroup.eleSourceImageList{{idx}}">
							<td class="hide">
								<input id="imageGroup.eleSourceImageList{{idx}}_id" name="imageGroup.eleSourceImageList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
								<input id="imageGroup.eleSourceImageList{{idx}}_delFlag" name="imageGroup.eleSourceImageList[{{idx}}].delFlag" type="hidden" value="0"/>
							</td>
							{{#editRow}}
							<td>
								<input id="imageGroup.eleSourceImageList{{idx}}_name" name="imageGroup.eleSourceImageList[{{idx}}].name" type="text" value="{{row.name}}" maxlength="255" class="input-small "/>
							</td>
							{{/editRow}}
							{{#addRow}}
							<td>
								<input id="imageGroup.eleSourceImageList{{idx}}_name" name="imageGroup.eleSourceImageList[{{idx}}].name" type="text" value="{{rowIdx}}" maxlength="255" class="input-small "/>
							</td>
							{{/addRow}}
							{{#editRow}}
							<td>
									<input id="imageGroup.eleSourceImageList{{idx}}_index" name="imageGroup.eleSourceImageList[{{idx}}].index" type="text" value="{{row.index}}" maxlength="10" class="input-small  digits required"/>	</td>
							{{/editRow}}
							{{#addRow}}
							<td>
								<input id="imageGroup.eleSourceImageList{{idx}}_index" name="imageGroup.eleSourceImageList[{{idx}}].index" type="text" value="{{rowIdx}}" maxlength="10" class="input-small  digits required"/>	</td>
							{{/addRow}}

							<td>
								<input type="hidden" path="imageGroup.eleSourceImageList[{{idx}}].path" name="imageGroup.eleSourceImageList[{{idx}}].path" id="path_{{idx}}" htmlEscape="false" class="input-xlarge required" value="{{row.path}}"/>
								<sys:ckfinder input="path_{{idx}}" type="images" uploadPath="/source/image" selectMultiple="false"/>
							</td>
							<td class="floor">
								<input id="imageGroup.eleSourceImageList{{idx}}_correspondingFloor" name="imageGroup.eleSourceImageList[{{idx}}].correspondingFloor" type="text" value="{{row.correspondingFloor}}" maxlength="255" class="input-small floorval" />
							</td>
						<%--	<td>
								<textarea id="eleSourceImageList{{idx}}_remarks" name="eleSourceImageList[{{idx}}].remarks" rows="1" maxlength="255" class="input-small ">{{row.remarks}}</textarea>
							</td>--%>
							<shiro:hasPermission name="source:image:eleSourceImageGroup:edit"><td class="text-center" width="10">
								{{#delBtn}}<span class="close" onclick="delRow(this, 'imageGroup.eleSourceImageList{{idx}}')" title="<spring:message code='common.delete'/>">&times;</span>{{/delBtn}}
							</td></shiro:hasPermission>
						</tr>//-->
				</script>
				<script type="text/javascript">
                    var eleSourceImageRowIdx = 0, eleSourceImageTpl = $("#eleSourceImageTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                    $(document).ready(function() {
                        var data = ${fns:toJson(eleSourceMultimedia.imageGroup.eleSourceImageList)};
                        for (var i=0; i<data.length; i++){
                            addRow('#eleSourceImageList', eleSourceImageRowIdx, eleSourceImageTpl, data[i]);
                            eleSourceImageRowIdx = eleSourceImageRowIdx + 1;
                        }
                    });
				</script>
			</div>
		</div>
	</div>
	<c:choose>
	<c:when test="${eleSourceMultimedia.type == 'image' }">		<div class="control-group" id="videoSource" style="display:none">
	</c:when>
	<c:otherwise>		<div class="control-group" id="videoSource">
	</c:otherwise>
	</c:choose>

	<label class="control-label"><spring:message code='video'/>：</label>
	<div class="controls">
		<table id="contentTable" class="table table-striped table-bordered table-condensed">
			<thead>
			<tr>
				<th class="hide"></th>
				<th><spring:message code="common.dname"/></th>
				<th><spring:message code='Start.play.date'/></th>
				<th><spring:message code='End.play.date'/></th>
				<th><spring:message code='Start.play.time'/></th>
				<th><spring:message code='End.play.time'/></th>
				<th><spring:message code='Continuous.playback.times'/><font color="red">*</font> </th>
				<th><spring:message code='Play.sequence.number'/><font color="red">*</font> </th>
				<th><spring:message code='video'/></th>
				<th><spring:message code='Live.link'/></th>
				<shiro:hasPermission name="source:video:eleSourceVideoGroup:edit"><th width="10">&nbsp;</th></shiro:hasPermission>
			</tr>
			</thead>
			<tbody id="eleSourceVideoList">
			</tbody>
			<shiro:hasPermission name="source:video:eleSourceVideoGroup:edit"><tfoot>
			<tr><td colspan="9"><a href="javascript:" onclick="addRow('#eleSourceVideoList', eleSourceVideoRowIdx, eleSourceVideoTpl);eleSourceVideoRowIdx = eleSourceVideoRowIdx + 1;" class="btn"><spring:message code="common.add"/></a></td></tr>
			</tfoot></shiro:hasPermission>
		</table>
		<script type="text/template" id="eleSourceVideoTpl">//<!--
						<tr id="videoGroup.eleSourceVideoList{{idx}}">
							<td class="hide">
								<input id="videoGroup.eleSourceVideoList{{idx}}_id" name="videoGroup.eleSourceVideoList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
								<input id="videoGroup.eleSourceVideoList{{idx}}_delFlag" name="videoGroup.eleSourceVideoList[{{idx}}].delFlag" type="hidden" value="0"/>
							</td>
							{{#editRow}}
							<td>
								<input id="videoGroup.eleSourceVideoList{{idx}}_name" name="videoGroup.eleSourceVideoList[{{idx}}].name" type="text" value="{{row.name}}" maxlength="255" class="input-small "/>
							</td>
							{{/editRow}}
							{{#addRow}}
							<td>
								<input id="videoGroup.eleSourceVideoList{{idx}}_name" name="videoGroup.eleSourceVideoList[{{idx}}].name" type="text" value="{{rowIdx}}" maxlength="255" class="input-small "/>
							</td>
							{{/addRow}}
							<td>
								<input id="videoGroup.eleSourceVideoList{{idx}}_startDate" name="videoGroup.eleSourceVideoList[{{idx}}].startDate" type="text" readonly="readonly" maxlength="20" class="input-small Wdate "
									value="{{row.startDate}}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false,lang:'${langCode}'});"/>
							</td>
							<td>
								<input id="videoGroup.eleSourceVideoList{{idx}}_endDate" name="videoGroup.eleSourceVideoList[{{idx}}].endDate" type="text" readonly="readonly" maxlength="20" class="input-small Wdate "
									value="{{row.endDate}}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false,lang:'${langCode}'});"/>
							</td>
							<td>
								<input id="videoGroup.eleSourceVideoList{{idx}}_startTime" name="videoGroup.eleSourceVideoList[{{idx}}].startTime" type="text" readonly="readonly" maxlength="20" class="input-small Wdate "
									value="{{row.startTime}}" onclick="WdatePicker({dateFmt:'HH:mm:ss',isShowClear:false,lang:'${langCode}'});"/>
							</td>
							<td>
								<input id="videoGroup.eleSourceVideoList{{idx}}_endTime" name="videoGroup.eleSourceVideoList[{{idx}}].endTime" type="text" readonly="readonly" maxlength="20" class="input-small Wdate "
									value="{{row.endTime}}" onclick="WdatePicker({dateFmt:'HH:mm:ss',isShowClear:false,lang:'${langCode}'});"/>
							</td>
							{{#editRow}}
							<td>
								<input id="videoGroup.eleSourceVideoList{{idx}}_frequency" name="videoGroup.eleSourceVideoList[{{idx}}].frequency" type="text" value="{{row.frequency}}" maxlength="10" class="input-mini  digits required"/>
							</td>
							{{/editRow}}	
							{{#addRow}}	
							<td>
								<input id="videoGroup.eleSourceVideoList{{idx}}_frequency" name="videoGroup.eleSourceVideoList[{{idx}}].frequency" type="text" value="1" maxlength="10" class="input-mini  digits required"/>
							</td>
							{{/addRow}}
							{{#editRow}}
							<td>
								<input id="videoGroup.eleSourceVideoList{{idx}}_index" name="videoGroup.eleSourceVideoList[{{idx}}].index" type="text" value="{{row.index}}" maxlength="10" class="input-mini digits required"/>
							</td>
							{{/editRow}}	
							{{#addRow}}	
							<td>
								<input id="videoGroup.eleSourceVideoList{{idx}}_index" name="videoGroup.eleSourceVideoList[{{idx}}].index" type="text" value="{{rowIdx}}" maxlength="10" class="input-mini digits required"/>
							</td>
							{{/addRow}}
							<td>
								<input path="videoGroup.eleSourceVideoList{{idx}}_path" name="videoGroup.eleSourceVideoList[{{idx}}].path" id="video_path_{{idx}}" type="hidden" value="{{row.path}}" maxlength="255"/>
								<sys:ckfinder input="video_path_{{idx}}" type="videos" uploadPath="/source/video/eleSourceVideoGroup" selectMultiple="false"/>
							</td>
							<td>
								<textarea id="videoGroup.eleSourceVideoList{{idx}}_liveUrl" name="videoGroup.eleSourceVideoList[{{idx}}].liveUrl" rows="2" maxlength="255" class="input-small ">{{row.liveUrl}}</textarea>
							</td>
							<shiro:hasPermission name="source:video:eleSourceVideoGroup:edit"><td class="text-center" width="10">
								{{#delBtn}}<span class="close" onclick="delRow(this, 'videoGroup.eleSourceVideoList{{idx}}')" title="<spring:message code='common.delete'/>">&times;</span>{{/delBtn}}
							</td></shiro:hasPermission>
						</tr>//-->
		</script>
		<script type="text/javascript">
            var eleSourceVideoRowIdx = 0, eleSourceVideoTpl = $("#eleSourceVideoTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
            $(document).ready(function() {
                var data = ${fns:toJson(eleSourceMultimedia.videoGroup.eleSourceVideoList)};
                for (var i=0; i<data.length; i++){
                    addRow('#eleSourceVideoList', eleSourceVideoRowIdx, eleSourceVideoTpl, data[i]);
                    eleSourceVideoRowIdx = eleSourceVideoRowIdx + 1;
                }
            });
		</script>
	</div>
</div>
	<div class="control-group">
		<label class="control-label"><spring:message code='common.remarks'/>：</label>
		<div class="controls">
			<form:textarea path="remarks" htmlEscape="false" rows="2" maxlength="255" class="input-xxlarge "/>
		</div>
	</div>
	<div class="form-actions">
		<shiro:hasPermission name="source:eleSourceMultimedia:edit">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="<spring:message code='common.save'/>"/>&nbsp;
		</shiro:hasPermission>
		<input id="btnCancel" class="btn" type="button" value="<spring:message code='common.back'/>" onclick="window.location.href='${ctx}/source/eleSourceMultimedia/list'"/>
	</div>
	<span id="timeVali" style="display: none;color: red"><spring:message code='time.tip'/></span>
	</form:form>
</body>
</html>